Fix cuda_bindings conjugate_gradient_multi_block_cg.py example#1922
Draft
rwgk wants to merge 2 commits intoNVIDIA:mainfrom
Draft
Fix cuda_bindings conjugate_gradient_multi_block_cg.py example#1922rwgk wants to merge 2 commits intoNVIDIA:mainfrom
rwgk wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Remove the unconditional NVRTC waiver from the renamed example so CI can exercise its real execution path again. While re-enabling it, replace the standalone pytest.skip() checks with requirement_not_met() and simplify the platform gating. The waived code path had been hiding several Python-side runtime bugs that required these fixes: - replaced the invalid C-style %d f-string formatting - fixed gen_tridiag() variable shadowing so the CSR row-offset array is actually populated - passed the computed dynamic shared-memory size into cuLaunchCooperativeKernel() and made that size integer-valued - stopped overwriting managed-memory pointer variables with loop indices before kernel launch and cleanup - cached the residual before freeing dot_result, which removed the teardown segfault Made-with: Cursor
QNX is an operating system rather than a machine architecture, so checking platform.machine() can miss the requirement_not_met() path on QNX hosts. Use platform.system() so the example is waived consistently on that platform. Made-with: Cursor
Contributor
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Collaborator
Author
|
/ok to test |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR started out as a humble attempt to eliminate the only remaining
pytest.skip()in our examples (similar to #1861), but it turned into a bug-fix pass once the example actually began running.cuda_bindings/examples/4_CUDA_Libraries/conjugate_gradient_multi_block_cg.pyby removing its unconditional NVRTC waiver (which dates all the way back to the initial cuda-python commit 4a36f83) and replacing standalonepytest.skip()calls withrequirement_not_met()%dformatting inside an f-stringgen_tridiag()variable shadowing that broke CSR constructiondot_result, which caused a teardown segfaultcuda_bindings/examples/3_CUDA_Features/global_to_shmem_async_copy.pyby checkingplatform.system() == "QNX"instead ofplatform.machine() == "qnx"— QNX is an operating system rather than a machine architecture, sochecking platform.machine() == "qnx"does not detect QNX hosts.